package com.iyimo.core.mvc{
	import com.iyimo.core.i.IController;
	import com.iyimo.core.i.IFacade;
	
	import flash.events.EventDispatcher;
	import flash.utils.Dictionary;

	public class Facade implements IFacade{
		private var _controllerMap:Dictionary = new Dictionary();
		public function Facade(){
			var listener:EventDispatcher = new EventDispatcher();
			Controller.initialize(listener);
			Proxy.initialize(listener);
		}
		
		public function registerController(name:String, controller:IController):void{
			_controllerMap[name] = controller;
			controller.onRegister();
		}
		
		public function retrieveController(name:String):IController{
			return _controllerMap[name];
		}
	}
}